package day_6;/*
 *@ 代阳敲的专属代码
 **/

public class AnonyInner {
    public static void main(String[] args) {
//        Outer1 outer = new Outer1();
//        outer.method();
        O1.i1 i1 = new O1.i1();
        i1.eat();
        O1 o1 = new O1();
        O1.i2 i2 = o1.new i2();
        i2.eat2();
}
}
class O1{
    public void syy() {


    }
    static class i1 {
        public void eat() {

        }
    }
    class i2{
            public void eat2(){

        }
    }

}
class Outer1 {
    private int num = 10;

    public void method() {
        System.out.println("外部类方法");
        IA ia = new IA() {
            public void eat() {
                System.out.println("内部类方法");
            }

        };
        System.out.println(ia.getClass().getName());
    }


    IB ib = new IB() {
        public void eat() {
            System.out.println("内部类方法");
        }
    };

    public static void main(String[] args) {
        IA ia = new IA() {
            public void eat() {
                System.out.println("匿名内部类");
            }
        };
        ia.eat();
    }
}

interface IA{
    public void eat();
}
abstract class IB {
    public abstract void eat();
}